<template>
  <div>父级组件</div>
  <FatherView :temp-msg="msg"></FatherView>

  <h3>{{ msg }}</h3>
</template>
<script setup>
import {ref,provide,readonly} from 'vue'
import FatherView from './components/FatherView.vue'
import { msgKey } from '@/utils/symbolKeys';
const msg = ref('hello')
// 提供依赖 只能在后台组件中获取数据
// provide(key,value)
// provide('msg',readonly(msg))
const changMsg = ()=>{
  msg.value = "萨瓦迪卡"
}
provide(msgKey,{
  'msg':readonly(msg),
  changMsg
})

</script>